<template>
  <el-card>
    <span slot="header">查看详情</span>
    订单id：{{ formData.id }}
    <el-divider></el-divider>
    订单号：{{ formData.orderNo }}
    <el-divider></el-divider>
    下单时间：{{ formData.orderTime }}
    <el-divider></el-divider>
    联系电话：{{ formData.phone }}
    <el-divider></el-divider>
    收货人：{{ formData.consignee }}
    <el-divider></el-divider>
    送货地址：{{ formData.deliverAddress }}
    <el-divider></el-divider>
    送达时间：{{ formData.deliveryTime }}
    <el-divider></el-divider>
    备注：{{ formData.remarks }}
    <el-divider></el-divider>
    订单金额：{{ formData.orderAmount }}
    <el-divider></el-divider>
    订单状态：{{ formData.orderState }}
    <el-divider></el-divider>
    <button style="background: deepskyblue;color:#fff;outline:none;border:none" @click="$router.push('/order')">返回到订单列表</button>
    <!-- <el-form :model="formData">
      <el-form-item></el-form-item>
    </el-form> -->
  </el-card>
</template>

<script>
import {getOrderDetailReq} from '@/api/order'

export default {
  data() {
    return {
      id: '',
      formData: {},
    }
  },
  methods: {
    async getData() {
      let res = await getOrderDetailReq({id: this.id})
      //   console.log('res :>> ', res)
      //   console.log('res.data :>> ', res.data)
      //   console.log('res.data.orderNo :>> ', res.data.orderNo)
      let {data} = res.data
      this.formData = data
      //   console.log('res.data.data.orderNo :>> ', res.data.data.orderNo)
    },
  },
  created() {
    //获取query传参
    this.id = this.$route.query.id
    this.getData()
  },
}
</script>

<style lang="scss" scoped></style>
